<template>
  <div class="gl_contentBox gl_heightFull">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="收入" name="1">
        <income v-if="isFirst" />
      </el-tab-pane>
      <el-tab-pane label="支出" name="2">
        <expenditure v-if="isSecond" />
      </el-tab-pane>
      <!-- <el-tab-pane label="退款审核" name="3">
        <refund v-if="refund" />
      </el-tab-pane> -->
    </el-tabs>
  </div>
</template>

<script>
import expenditure from './expenditure';
import income from './income';
// import refund from './refund';
export default {
  components: {
    income,
    // refund,
    expenditure
  },
  data() {
    return {
      activeName: '1',
      isFirst: true,
      isSecond: false,
      refund: false
    };
  },
  methods: {
    handleClick(tab) {
      if (tab.name === '1') {
        this.isFirst = true;
        this.isSecond = false;
      } else if (tab.name === '2') {
        this.isFirst = false;
        this.isSecond = true;
      }
    }
  }
};
</script>
